/**
 * 对象工具类
 * @Author: lzmxqh  
 * @Date: 2022-10-23 23:47:41  
 * @Last Modified by:   lzmxqh  
 * @Last Modified time: 2022-10-23 23:47:41  
 */
export class ObjectUtils {
    /**深拷贝对象数据 */
    public static deepCopy<T>(data: T): T {
        if (!(data instanceof Object)) {
            return data;
        }

        let copyData: any;
        if (data instanceof Array) {
            copyData = [];
        } else if (typeof data == "function") {
            return data;
        } else {
            copyData = {};
        }
        for (const key in data) {
            copyData[key] = ObjectUtils.deepCopy(data[key]);
        }
        return copyData;
        // return JSON.parse(JSON.stringify(data));
    }
}